#!/bin/bash
###############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
###############################################################################
# Check code for issues.
set -o errexit

if [ -z "$BASH_VERSION" ]; then
  echo "This script must be run under bash"
  exit 1
fi

# Set script folder
script_dir="$( cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 ; pwd -P )"

# Set root folder
proj_dir="$( dirname "${script_dir}" )"

pushd "${proj_dir}"
    pre-commit run --hook-stage manual gitlint-ci
    pre-commit run --all-files
popd
